package com.csdn.questions;

import java.util.Scanner;

public class test3 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int num=sc.nextInt();
//        计算该数的位数
        int count=0;
//        用于存放余数
        int []arr=new int[5];
        while(num!=0){
            arr[count++]=num%10;
            num=num/10;
        }
        System.out.println("该数的位数为："+count);
        int i=count;
        System.out.print("该数正序逐位输出为：");
        while(count!=0){
            System.out.print(arr[--count]);
        }
        System.out.print("\n");
        System.out.print("该数逆序逐位输出为：");
        int j=0;
        while(j<i) {
            System.out.print(arr[j++]);
        }
    }
}


